
package com.yungu.swift.system.marketing.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.yungu.swift.base.ResponseData;
import com.yungu.swift.base.mapper.IMapper;
import com.yungu.swift.base.service.impl.BaseServiceImpl;
import com.yungu.swift.system.marketing.dao.MarketingGiftWillDrawMapper;
import com.yungu.swift.system.marketing.model.dto.MarketingGiftWillDrawDto;
import com.yungu.swift.system.marketing.service.MarketingGiftWillDrawService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @author xiuyin.cui - Generate
 * @version 1.1.0-SNAPSHOT
 * @since 2019-04-25 13:50
 */
@Service
public class MarketingGiftWillDrawServiceImpl extends BaseServiceImpl<MarketingGiftWillDrawDto> implements MarketingGiftWillDrawService {

    @Autowired
    private MarketingGiftWillDrawMapper marketingGiftWillDrawMapper;

    @Override
    protected IMapper<MarketingGiftWillDrawDto> getMapper() {
        return marketingGiftWillDrawMapper;
    }

    @Override
    public ResponseData<Boolean> addBatch(List<MarketingGiftWillDrawDto> list) {
        return ResponseData.buildSuccessResponse(marketingGiftWillDrawMapper.addBatch(list) > 0);
    }

    @Override
    public ResponseData<Boolean> updateStatusByGetMode(Integer status, Integer getMode) {
        return ResponseData.buildSuccessResponse(marketingGiftWillDrawMapper.updateStatusByGetMode(status, getMode) > 0);

    }
}
